home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-09-15 | 2.2 KB | 84 lines | [TEXT/MACA] |
-
- ; GetScreenSize.ASM
- ; This module finds out the size of the screen currently installed
- ; on your Mac
- ; It fills in a VAR rectangle with the coordinates of ;screenbits.bounds
-
- INCLUDE QuickEqu.D
-
- XDEF GetScreenSize
- ; Procedure GetScreenSize(VAR r:rect)
-
- GetScreenSize
-
- r SET 8 ;offset to rectangle parameter
- parambytes SET 4 ; bytes for parameter
-
-
- LINK A6,#0 ; no locals
- MOVE.L r(A6),A1 ; get dest rect
- MOVE.L GrafGlobals(A5),A0 ; get QD globals
- LEA screenBits+bounds(A0),A0
-
- MOVE.L (A0)+,(A1)+ ; move the first part
- MOVE.L (A0)+,(A1)+ ; move the rest
-
- UNLK A6 ; get rid of stack frame
- MOVE.L (SP)+,A0 ; return address
- ADDA.W #parambytes,SP ; strip parameter
- JMP (A0) ; return
-
- ;--------------------------- DoDrag --------------------------------------
- DoDrag
- ; The click was in the drag bar of the window. Drag it.
-
- ; xProcedure GetScreenSize(VAR r:Rect)
- PEA tRect(A5) ; global scratch rect
- JSR GetScreenSize
-
- ;Procedure InsetRect(VAR r:Rect;dh,dv:INTEGER)
- PEA tRect(A5) ; the rect
- MOVE.W #20,-(SP) ; dh
- MOVE.W #20,-(SP) ; dv
- _InsetRect
-
- ; DragWindow (theWindow:WindowPtr; startPt: Point; boundsRect: Rect);
- MOVE.L WWindow(A5),-(SP) ; Pass window
- MOVE.L Point(A5),-(SP) ; mouse coordinates
- PEA tRect(A5) ; and boundaries
- _DragWindow ; Drag Window
-
- BRA NextEvent ; Go get next event
-
-
-
-
- ;---------------------------- DoGrow -------------------------------------
- DoGrow
-
- ; first include the scroll bar and grow region in update region
- BSR InvalidScroll
-
- ; here is where we actually grow the window
- ; xProcedure GetScreenSize(VAR r:Rect)
- PEA tRect(A5) ; global scratch rect
- JSR GetScreenSize
-
- ADD.W #70,tRect+top(A5) ; 70 pixels high
- ADD.W #70,tRect+left(A5) ; 70 pixels wide
- SUB.W #15,tRect+bottom(A5) ; not too tall
- MOVE.W #$7FFF,tRect+right(A5) ; extra-wide OK
-
- ;FUNCTION GrowWindow(theWindow:WindowPtr;startPt:Point;
- ; sizeRect:Rect):LONGINT
- CLR.L -(SP) ; space for result
- MOVE.L WWindow(A5),-(SP) ; theWindow
- MOVE.L Point(A5),-(SP) ; startPt
- PEA tRect(A5) ; sizeRect
- _GrowWindow
- MOVE.W (SP)+,D1 ; new vertical dimension
- MOVE.W (SP)+,D0 ; new horizontal dimension
-
- ; now draw it to the new size
-
-